import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import MidView from '@/views/MidView.vue'
import MyView from '@/views/MyView.vue'
import TabNavBar from '@/components/layouts/TabNavBar.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: "/tab",
      name: 'tab',
      component: TabNavBar,
      children: [
        {
          path: 'home',
          name: 'home',
          meta: {
            keepAlive: true,
          },
          component: HomeView
        },
        {
          path: 'mid',
          name: 'mid',
          meta: {
            keepAlive: true,
          },
          component: MidView
        },
        {
          path: 'my',
          name: 'my',
          meta: {
            keepAlive: true,
          },
          component: MyView
        }
      ]
    }
  ]
})

export default router
